#ifndef _EquipItem_h__
#define _EquipItem_h__

#include "Global.h"




#include "ListItem.h"
#include "item/Item.h"
#include "EquipIcon.h"

class EquipItem
	: public ListItem
	, public cocos2d::extension::CCBMemberVariableAssigner
	, public cocos2d::extension::CCBSelectorResolver
	, public cocos2d::extension::CCNodeLoaderListener
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(EquipItem, create);

	EquipItem(void);
	~EquipItem(void);

	virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode);
	virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader);
	bool init();
	void refresh();
	void onEnter();
	void onExit();
	void showCheckBox(bool visible);
    bool isSelect();

	CheckBox* mCheckBox;
private:
	CCLabelTTF* mName;
	CCLabelTTF* mLevel;
	CCLabelTTF* mType;
	CCLabelTTF* mProperty;
	CCLabelTTF* mPropertyTitle;
	EquipIcon* mEquipIcon;
    CC_SYNTHESIZE(bool, mIsClickBg, IsClickBg);

	void onBgClick(CCObject* pSender);
	void onAttributeBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void _onNotification(CCObject* pSender);
};

#endif